﻿
using System;
using System.Diagnostics;
using System.IO;

namespace MX.Core.Caching.Redis.Sider
{
	internal   class Invocation<T>
	{
		[DebuggerStepThrough]
		public static Invocation<T>  New (string command,
		                                  Action<ProtocolWriter,Stream> writer,
		                                  Func<ProtocolReader ,Stream,T> reader)
		{
			return new Invocation<T> (command, writer, reader);
		}

		public string Command { get; private set; }

		public Action<ProtocolWriter,Stream> WriteAction { get; private set; }

		public Func<ProtocolReader,Stream,T> ReadAction { get; private set; }

	 

		public Invocation (string command,
		                   Action<ProtocolWriter,Stream> writer,
		                   Func<ProtocolReader,Stream,T > reader)
		{
			Command = command;
			WriteAction = writer;
			ReadAction = reader;
		 
		}
	}



	 
}
